using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Globalization;

namespace CodePlex.ExtractedDataReorganizer
{
    class HelperFunctions
    {
        public string RenameFile(string FileName)
        {
            CultureInfo ci = new CultureInfo("en-us");
            FileInfo fi = new FileInfo(FileName);
            string newname = FileName.Substring(0, FileName.Length - fi.Extension.Length);
            string ext=fi.Extension;

            for (int i = 1; i < 100; i++)
            {
                ext = i.ToString("D3", ci)+".xml";
                if (!File.Exists(newname + ext))
                    break;

            }
            newname = newname + ext;
            return newname;

        }
    }
}
